<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html lang="en">
<?php $title = '名片夹'; ?>
<head>
	<meta charset="UTF-8">
	<title><?php echo ($title); ?></title>
    <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
	<link rel="stylesheet" href="/Application/Home/View//Public/static/css/weui.min.css"/>
    <link rel="stylesheet" href="/Application/Home/View//Public/static/css/jquery-weui.min.css"/>
    <link rel="stylesheet" href="/Application/Home/View//Public/static/css/custom.css"/>
    <style type="text/css">
		body{
			background:#f1f1f1;
			color:#a3a3a3;
			font-family:"Microsoft YaHei";
		}
		.bd{
			padding:20px;
		}
        li{list-style: none;}
		p{
			font-size: 13px;
		}
		.weui-cell_select-before .weui-cell__hd:before{
			border-width: 0px 2px 2px 0;
			margin-top: -6px;
		}
		.weui-cell_select-before .weui-cell__hd:after{border:none;}
        .sstmb {
            padding-bottom: 60px;
        }
        .foot-ul{
			text-align:center;
			margin-top: 1rem;
			padding:10px;
			background: #22a9fe;
			opacity: 0.9;
		}
		.foot-ul a{
			color: #fff;
		}
		.foot-ul a img{
			max-width: 24px;
		}
		.pinglun{
			padding: 0 2px;
			background: #ff5959;
			border-radius: 50px;
			color: #fff;
			position: absolute;
			top:-6px;
			left:73px;
			font-size: 13px;
		}
		
		
		.weui-cell__bd p{
		color:#6b6969;
		}
        
	</style>
</head>

<body ontouchstart>

  <style type="text/css">
    
    body{
      
      color:#3b3b3b;
      font-family:"Microsoft YaHei";
    }
    .weui-cell__hd img{
      width: 4.5rem;
    }
    /*.weui-cell__bd{margin-top: -2rem;}*/
    .weui-btn{line-height:2}
   .weui-cell__bd p{
    margin-left: 10px;
    font-size: 14px;
   }
   .weui-cell:before{left:0;}
   .btn{
    width:3.5rem;
    border-radius:20px;
    margin-top: 15px;
    margin-left:10px;
    display: inline-block;
   }
   .profession{
    color:#bbb;
    font-size: 14px;
    height: 22px;
    overflow: hidden;
   }
  </style>
    <div class="container js_container">

    </div>
<div class="page">
  <div class="weui-search-bar" id="searchBar">
  <form class="weui-search-bar__form" action='<?php echo U("index/cards");?>' method='POST'>
    <div class="weui-search-bar__box">
      <i class="weui-icon-search"></i>
      <input type="search" class="weui-search-bar__input" name='keywords' id="searchInput" placeholder="搜索" value='<?php echo ($keywords); ?>'>
      <a href="javascript:" class="weui-icon-clear" id="searchClear"></a>
    </div>
    <label class="weui-search-bar__label" id="searchText">
      <i class="weui-icon-search"></i>
      <span>搜索</span>
    </label>
  </form>
  <a href="javascript:" class="weui-search-bar__cancel-btn" id="searchCancel">取消</a>
</div>

<?php if(count($list) > 0): ?><div id='lists'>
<?php if(is_array($list)): $i = 0; $__LIST__ = $list;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><div class="weui-cells pre" onclick='goto(<?php echo ($vo["id"]); ?>)'>
  <div class="weui-cell">
    <div class="weui-cell__hd"><img src="/uploads/<?php echo ($vo["avatar"]); ?>"></div>
    <div class="weui-cell__bd">
      <p style="color:#2d2d2d;font-size:16px;padding-bottom: 8px;"><?php echo ($vo["true_name"]); ?> <img style="vertical-align:middle;margin-left: 0.3rem;width:8%;" src="/Application/Home/View//Public/static/images/v.png"></p>
      <p class="profession"><?php echo ($vo["company_name"]); ?></p>
      <p class="profession"><?php echo ($vo["position"]); ?></p>
    </div>
  </div>

</div><?php endforeach; endif; else: echo "" ;endif; ?>
</div>
    <div style="text-align:center;color:#6dbffe;margin-top: 25px;" onclick='load_more()' id='load_more'>更多结果...</div>
<?php else: ?>
    <div style="text-align:center;color:#6dbffe;margin-top: 25px;">暂无结果!</div><?php endif; ?>
    </div>
<div class="sstmb"></div>
<div class="foot-ul" style="position:fixed;bottom:0;width:100%;">
	<ul class="weui-flex ">
		<a class="weui-flex__item " href="<?php echo U('Card/index');?>&userid=<?php echo (session('userid')); ?>"><li ><img src="/Application/Home/View//Public/static/images/foot (1).png"><p style="line-height: 10px;">我的名片</p></li></a>
        
        <?php if($_SESSION['userid']!= ""): ?><a class="weui-flex__item " href="<?php echo U('index/card_edit');?>"><li ><img src="/Application/Home/View//Public/static/images/foot (3).png"><p style="line-height: 10px;">制作名片</p></li></a>
		<?php else: ?>
            <a class="weui-flex__item " href="<?php echo U('login/register');?>&tid=<?php echo ($tid); ?>"><li ><img src="/Application/Home/View//Public/static/images/foot (3).png"><p style="line-height: 10px;">制作名片</p></li></a><?php endif; ?>
        <a class="weui-flex__item " href="<?php echo U('index/cards');?>"><li ><img src="/Application/Home/View//Public/static/images/foot (2).png"><p style="line-height: 10px;">名片夹</p></li></a>
		<a class="weui-flex__item " href="<?php echo U('index/more');?>"><li ><img src="/Application/Home/View//Public/static/images/foot (4).png"><p style="line-height: 10px;">更多</p></li></a>
	</ul>
</div>

    <script src="/Application/Home/View//Public/static/js/jquery-2.1.4.js"></script>
    <script src="/Application/Home/View//Public/static/js/jquery-weui.min.js"></script>
    <script src="/Application/Home/View//Public/static/js/fastclick.js"></script>
    <script src="/Application/Home/View//Public/static/layer/layer.js"></script>
    <script src="/Application/Home/View//Public/static/js/jquery.form.js"></script>
    <script>
      $(function() {
        FastClick.attach(document.body);
      });
    </script>
</body>
</html>

<script>
   function goto(id){
      location.href="<?php echo U('Card/index/');?>&userid="+id;
   }
   
   function load_more(){
      $.showLoading();
      $.ajax({
         url:'<?php echo U("index/ajax_get_cards");?>',
         data:{'cur_count':$(".pre").length, 'keywords':$("#searchInput").val()},
         dataType:'JSON',
         success:function(data){
            $.hideLoading();
            if(data.length > 0){
                for(var i=0;i<data.length;i++){
                    var tmp = "<div class='weui-cells pre' onclick='goto("+data[i].id+")'><div class='weui-cell'><div class='weui-cell__hd'><img src='/uploads/"+data[i].avatar+"'></div><div class='weui-cell__bd'>";
                    tmp += "<p style='color:#2d2d2d;font-size:16px;padding-bottom: 8px;'>"+data[i].true_name+"<img style='vertical-align:middle;margin-left: 0.3rem;width:8%;'";
                    tmp += "src='/Application/Home/View//Public/static/images/v.png'></p>";
                    tmp += "<p class='profession'>"+data[i].company_name+"</p><p class='profession'>"+data[i].position+"</p></div></div></div>";
                    $("#lists").append(tmp);
                }
            }else{
               $("#load_more").html('没有更多数据!');
            }
        }
      })
   }
</script>